#ifndef JGLWIDGET_H
#define JGLWIDGET_H

#include <QGLWidget>
#include "QGLViewer/qglviewer.h"
//#include "GLToMovie.h"

//class GLToMovie;

class JGLWidget : public QGLViewer
{
	Q_OBJECT

public:
	JGLWidget(QWidget *parent, int mWidth, int mHeight);
	~JGLWidget();

	QDomElement domElement(const QString& name, QDomDocument& document) const;

public slots:
	void initFromDOMElement(const QDomElement& element);

	void loadSTL(const QString& filename);
	void loadJTS(const QString& filename);

	void beginRecordingMovie();
	void stopRecordingMovie();

signals:

protected:
	void preDraw();
	void draw();
	void postDraw();
	void init();
	QString helpString() const;

private:

	//GLuint Tib_display_list;
	GLuint Fem_display_list;

	bool showTibia;
	bool m_bIsRecording;

	//GLToMovie g_MovieRecorder;

	/*int m_nWidth;
	int m_nHeight;
	int m_nMovieWidth;
	int m_nMovieHeight;*/

	int			m_nWidth;			/*Movie Frame Width*/
	int			m_nHeight;			/*Movie Frame Height*/
	int			m_nBitsPerPixel;	/*Number of Bits per Pixel*/
	LPVOID		m_pBits;			/*Pointer to Memory required to hold the Frame Content*/

	//void initializeGL();
	//void paintGL();
	//void resizeGL(int width, int height);

	/*void mousePressEvent(QMouseEvent *e);
	void mouseMoveEvent(QMouseEvent *e);
	void mouseReleaseEvent(QMouseEvent *e);
	void wheelEvent(QWheelEvent *e);

	void keyPressEvent(QKeyEvent *e);
	void keyReleaseEvent(QKeyEvent *e);*/
	
	//int mHeight;
	//int mWidth;
};

#endif // JGLWIDGET_H
